How Do I Connect to Data Using My API Key for Authorization in the Java Report Engine?
This article explains the process of changing your Access Provider to Request Header in the Java Report Engine. This new feature allows better security of your API key since you no longer need to specify the key a URL (which can be cached and shared).
To add a new API data source with Request Header Authorization, copy and paste the following code into your report object file . Be sure to insert your API token, key, URL, and name where instructed:
DataSourceProvider MyDatasource_3 = new JsonDataSource("AccessProvider=RequestHeader;HKey=**Insert API Token Here**;Password=**Insert API Key Here**;Encoding=utf-8;Url=**Insert API URL Here**;", JsonDataSource.MODE_CONNECTION_STRING);
dataSources.put("**Insert API Name Here**", MyDatasource_3);